<?php

defined('SYSPATH') OR die('No direct access allowed.');

class Role_Controller extends Controller {

    public function __construct() {
        parent::__construct();
        $this->role_model = new Role_Model;
    }

    public function index() {        
        if(!parent::_authenticate()) {
			return;
		}
		parent::_loadContent("Role", 'role_content');
		$this->view->content->role = $this->role_model;
        $this->view->render(TRUE);
    }

    public function add_role() {
        $this->role_model->insert_role(array('nama' => $this->input->post('nama')));
        url::redirect('role');
    }

}
